#include <windows.h>
#include <shlobj.h>

int main() {
    CoInitialize(NULL);
    
    IFileOperation* pfo;
    CoCreateInstance(CLSID_FileOperation, NULL, CLSCTX_ALL, IID_PPV_ARGS(&pfo));
    
    IShellItem* psiFrom;
    SHCreateItemFromParsingName(L"C:\\source.txt", NULL, IID_PPV_ARGS(&psiFrom));
    
    IShellItem* psiTo;
    SHCreateItemFromParsingName(L"C:\\dest\\", NULL, IID_PPV_ARGS(&psiTo));
    
    pfo->CopyItem(psiFrom, psiTo, NULL, NULL);
    pfo->PerformOperations();
    
    psiFrom->Release();
    psiTo->Release();
    pfo->Release();
    CoUninitialize();
    return 0;
}